#!/bin/sh

useage()
{
echo "Useage:" 
echo "  reset [-h|--help]"
echo "  This command can restore config file to factory defaults."
echo ""
exit
}

if [ $1 = "--help" -o $1 = "-h" ]
then
	useage
fi

echo "Are you sure to resume default config? (Y/N)"
read ans
        case "$ans"  in
        [Yy]*)
		/bin/cp -rf /etc/config/default.xml /etc/config/config.xml
		/bin/sync && /bin/sync && /bin/sync && /bin/sync
		echo "Restore complete."
		echo "Please reboot your system and apply your operation."
                exit;;
        *)
                exit;;
        esac
